<?php
class Login_model extends Model {

    function Login_model()
    {
        // Call the Model constructor
        parent::Model();
    }
		

	
	function check_login($user, $password)
	{
		
		$query = $this->db->query("SELECT * FROM ci_users where e_mail like '$user' and password like '$password'");
		if($query->num_rows() > 0)
		{
			$row = $query->row();
			return $row;
		}	
		else
		    throw new Exception('Wrong address mail or password');
	}
	
}
?>